From 87970ea2d0eff3eaa148676d7726043e99794c26 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 9 Oct 2014 11:03:47 +0200 Subject: [PATCH] Add GDK_ALWAYS_USE_GL debug hack If this is set we always use GL to render each window, even if there are no GL widgets in the window. --- gdk/gdkwindow.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 18c0de6472..a73725487b 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -287,11 +287,16 @@ create_surface_accumulator (GSignalInvocationHint *ihint, static GQuark quark_pointer_window = 0; +static gboolean always_use_gl = FALSE; + static void gdk_window_class_init (GdkWindowClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + if (g_getenv ("GDK_ALWAYS_USE_GL")) + always_use_gl = TRUE; + parent_class = g_type_class_peek_parent (klass); object_class->finalize = gdk_window_finalize; @@ -1418,6 +1423,18 @@ gdk_window_new (GdkWindow *parent, g_signal_connect (device_manager, "device-removed", G_CALLBACK (device_removed_cb), window); + + if (always_use_gl) + { + GError *error = NULL; + + if (gdk_window_get_paint_gl_context (window, &error) == NULL) + { + g_warning ("Unable to force GL enabled: %s\n", error->message); + g_error_free (error); + } + } + return window; } -- 2.30.2